function Promisee(executor){
    this.state = 'pending';
    this.result = undefined;
    try {
        executor(function (value){
            if(this.state !== 'pending') return;
            this.state = 'fulfilled';
            this.result = value;
        }.bind(this),function (value){
            if(this.state !== 'pending') return;
            this.state = 'rejected';
            this.result = value;
        })
    }catch(err){
        if(this.state !== 'pending') return;
        this.state = 'rejected';
        this.result = err;
    }

}
const p = new Promisee(function (resolve,reject){
    // console.log(123);
})

console.log(p);

